home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _SQLite_Encode.au3 < prev    next >
Text File  |  2007-09-08  |  917b  |  23 lines

  1. #include <SQLite.au3>
  2. #include <SQLite.dll.au3>
  3.  
  4. Local $hFile, $vData, $sFileName, $sData, $hQuery, $aRow, $sMsg
  5. _SQLite_Startup()
  6. _SQLite_Open()
  7. _SQLite_Exec(-1,"CREATE TABLE IF NOT EXISTS Test (data blob);")
  8. $vData = Binary("Hello" & Chr(0) & "World"); = 48656C6C6F00576F726C64
  9. $sData = _SQLite_Encode($vData)
  10. _SQLite_Exec(-1,"INSERT INTO Test VALUES (" & $sData & ");")
  11. $vData = Binary(Chr(0) & @CRLF); = 000D0A
  12. $sData = _SQLite_Encode($vData)
  13. _SQLite_Exec(-1,"INSERT INTO Test VALUES (" & $sData & ");")
  14. $vData = Binary(Chr(0)); = 00 but this is interpreted as Number and returns 0000000000000000
  15. $sData = _SQLite_Encode($vData)
  16. _SQLite_Exec(-1,"INSERT INTO Test VALUES ( " & $sData & " );")
  17. _SQLite_Query(-1,"SELECT * FROM Test;",$hQuery)
  18. While _SQLite_FetchData ($hQuery, $aRow, 1) = $SQLITE_OK
  19.     $sMsg &= Hex($aRow[0]) & @CR
  20. WEnd
  21. MsgBox(0,"Result",$sMsg)
  22. _SQLite_Close()
  23. _SQLite_Shutdown()